<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\OrderDelivery
 *
 * @property int $id
 * @property string $order_id (商家订单号,string)业务系统订单号
 * @property int $delivery_id (配送活动标识,long,自己生成)业务系统配送单号
 * @property int $merchant_id 店铺id
 * @property int $enterprise_id 企业id
 * @property string $mt_peisong_id (请求后返回)美团配送单号
 * @property int $delivery_distance (请求后返回)配送距离
 * @property float $delivery_fee (请求后返回)配送价格
 * @property string $outer_order_source_desc 订单来源：101.美团（外卖&闪购）102.饿了么 103.京东到家 201.商家web网站 202.商家小程序-微信 203.商家小程序-支付宝 204.商家APP 205.商家热线 其他，请直接填写中文字符串，最长不超过20个字符 非「其他」需传代码
 * @property string $outer_order_source_no 原平台订单号，如订单来源为美团，该字段必填，且为美团平台生成的订单号，最长不超过32个字符
 * @property string $shop_id 取货门店id
 * @property int $delivery_service_code 配送服务代码，详情见合同
 * @property string $receiver_name
 * @property string $receiver_address
 * @property string $receiver_phone
 * @property int $receiver_lng 收件人经度（火星坐标或百度坐标，和 coordinate_type 字段配合使用），坐标 * （10的六次方），如 116398419
 * @property int $receiver_lat 收件人纬度（火星坐标或百度坐标，和 coordinate_type 字段配合使用），坐标 * （10的六次方），如 39985005
 * @property int $coordinate_type 坐标类型，0：火星坐标（高德，腾讯地图均采用火星坐标） 1：百度坐标 （默认值为0）
 * @property float $goods_value 货物价格，单位为元，精确到小数点后两位，范围为0-5000;跑腿B（4031）帮送服务包：范围0-3000
 * @property float $goods_height 货物高度，单位为cm，精确到小数点后两位,范围为0-45
 * @property float $goods_width 货物宽度，单位为cm，精确到小数点后两位，范围为0-50
 * @property float $goods_length 货物长度，单位为cm，精确到小数点后两位，范围为0-65
 * @property float $goods_weight 货物重量，单位为kg，精确到小数点后两位，范围为0-50;跑腿B（4031）帮送服务包：范围0-20
 * @property string|null $goods_detail 货物详情，最长不超过10240个字符，内容为JSON格式
 * @property string $goods_pickup_info 货物取货信息，用于骑手到店取货，最长不超过100个字符
 * @property string $goods_delivery_info 货物交付信息，最长不超过100个字符
 * @property string|null $expected_pickup_time 期望取货时间,立即取件 无需输入取件时间
 * @property string|null $expected_delivery_time 期望送达时间
 * @property int $order_type 订单类型，默认为0 0: 即时单(尽快送达，限当日订单) 1: 预约单
 * @property string $poi_seq 门店订单流水号，建议提供，方便骑手门店取货，最长不超过32个字符
 * @property string $note 备注，最长不超过200个字符。
 * @property float $cash_on_delivery 骑手应付金额，单位为元，精确到分【预留字段】
 * @property float $cash_on_pickup 骑手应收金额，单位为元，精确到分【预留字段】
 * @property string $invoice_title
 * @property int $tip_amount 加小费字段，加小费，精确到元，需要为1或1的倍数，上限20，允许每个运单最多加10次； 非跑腿B帮送服务包不支持
 * @property int $goods_code_switch 收货码开关，默认为0，0=off，1=on，当收件人手机号为隐私号时，不支持收货码； 非跑腿B帮送服务包不支持
 * @property string $courier_name
 * @property string $courier_phone
 * @property string $cancel_reason_id
 * @property string $cancel_reason
 * @property string $predict_delivery_time
 * @property int $status 状态代码，可选值为 0：待调度 20：已接单 30：已取货 50：已送达 99：已取消
 * @property string|null $operate_time 订单状态变更时间，格式为unix-timestamp
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\OrderDelivery onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCancelReason($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCancelReasonId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCashOnDelivery($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCashOnPickup($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCoordinateType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCourierName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCourierPhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereDeliveryDistance($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereDeliveryFee($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereDeliveryId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereDeliveryServiceCode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereEnterpriseId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereExpectedDeliveryTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereExpectedPickupTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsCodeSwitch($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsDeliveryInfo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsDetail($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsHeight($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsLength($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsPickupInfo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsValue($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsWeight($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereGoodsWidth($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereInvoiceTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereMerchantId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereMtPeisongId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereNote($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereOperateTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereOrderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereOrderType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereOuterOrderSourceDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereOuterOrderSourceNo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery wherePoiSeq($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery wherePredictDeliveryTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereReceiverAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereReceiverLat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereReceiverLng($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereReceiverName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereReceiverPhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereShopId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereTipAmount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderDelivery whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\OrderDelivery withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\OrderDelivery withoutTrashed()
 * @mixin \Eloquent
 */
class OrderDelivery extends Model
{
    use SoftDeletes;
    public static function getStatusName($status = 0): string
    {
        if ($status == 0) return '待调度';
        if ($status == 20)return '已接单';
        if ($status == 30)return '已取货';
        if ($status == 50)return '已送达';
        if ($status == 99)return '已取消';
    }
}
